package com.dm.cloud.images.mapper;

import com.dm.cloud.tkmybatis.service.BaseMapper;
import com.dm.cloud.images.common.po.ImagesAppTaskContainer;
import org.apache.ibatis.annotations.*;

/**
   * @author hcx
   * @type ImagesAppTaskContainerMapper.java
   * @desc ImagesAppTaskContainer mapper
   */

@Mapper
public interface ImagesAppTaskContainerMapper extends BaseMapper<ImagesAppTaskContainer> {

    @Update("update T_IMAGES_APP_TASK_CONTAINER set status=#{status} where id=#{id}")
    int updateStatusById(@Param("id") String id, @Param("status") int status);

    @Update("update T_IMAGES_APP_TASK_CONTAINER set result=#{result} where id=#{id}")
    int updateResoultById(@Param("id") String id, @Param("result") int result);

    @Update("update T_IMAGES_APP_TASK_CONTAINER set status=#{status} where task_id=#{taskId} and node_id=#{nodeId} and container_id=#{containerId}")
    int updateStatusByContainer(@Param("taskId") String taskId, @Param("nodeId") String nodeId, @Param("containerId") String containerId, @Param("status") int status);

    @Update("update T_IMAGES_APP_TASK_CONTAINER set result=#{result} where task_id=#{taskId} and node_id=#{nodeId} and container_id=#{containerId}")
    int updateResoultByContainer(@Param("taskId") String taskId, @Param("nodeId") String nodeId, @Param("containerId") String containerId, @Param("result") int result);


    @Update("update T_IMAGES_APP_TASK_CONTAINER set result=#{result},err_str=#{errStr} where task_id=#{taskId} and node_id=#{nodeId} and container_id=#{containerId}")
    int updateResultAndErrStrByContainer(@Param("taskId") String taskId, @Param("nodeId") String nodeId, @Param("containerId") String containerId, @Param("result") int result,@Param("errStr") String errStr);

}
